<template>
    <van-nav-bar title="消费订单" left-text="" left-arrow @click-left="goBack" />
    <van-cell v-for="record in recordList" center 
        title="" 
        :value="record.createTime_text"
        :label="record.content" 
    />
</template>

<script setup>

const { proxy } = getCurrentInstance();
const goBack = () => { proxy.$router.push('/business/index') }
const LoginUser = reactive(proxy.$cookies.get('LoginUser') ?? {});
const recordList = ref([]);

// 组装请求数据
const data = {
    busid: LoginUser.id,
}

const records = async () => {
    let result = await Api.record(data)
    if (result.code == 1) {
        recordList.value = result.data.list;
        console.log(recordList.value);
    }
}

onBeforeMount(() => {
    records()
})

</script>